Ubuntu 15.04
Sponsored Link

Configure iSCSI Target
2015/05/06
 
Configure Storage Server with iSCSI.
A storage on a network is called iSCSI Target, a Client which connects to iSCSI Target is called iSCSI Initiator.
This example is based on the environment below.
+----------------------+          |          +----------------------+
| [   iSCSI Target   ] |10.0.0.30 | 10.0.0.31| [ iSCSI Initiator  ] |
|     dlp.srv.world    +----------+----------+   client.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1] Install administration tools.
root@dlp:~#
apt-get -y install iscsitarget iscsitarget-dkms
[2] Configure iSCSI Target .
For example, create a disk image under the [/iscsi_disks] directory and set it as a shared disk.
# create a disk image

root@dlp:~#
mkdir /iscsi_disks

root@dlp:~#
dd if=/dev/zero of=/iscsi_disks/disk01.img count=0 bs=1 seek=80G
root@dlp:~#
vi /etc/default/iscsitarget
# change

ISCSITARGET_ENABLE=
true
root@dlp:~#
vi /etc/iet/ietd.conf
# add follows to the end

# if you set some devices, add <target>***</target> and set the same way with follows

# naming rule : [ iqn.yaer-month.domain:any name ]

Target iqn.2015-05.world.srv:target00
   
# provided devicce as a iSCSI target

    Lun 0 Path=/iscsi_disks/disk01.img,Type=fileio
   
# iSCSI Initiator's IP address you allow to connect

    initiator-address 10.0.0.31
   
# authentication info ( set anyone you like for "username", "password" )

    incominguser username password
root@dlp:~#
systemctl restart iscsitarget
# confirm status

root@dlp:~#
ietadm --op show --tid=1

Wthreads=8
Type=0
QueuedCommands=32
NOPInterval=0
NOPTimeout=0
 
Tweet